package ma.klagrida;

import javax.faces.bean.ManagedBean;

import org.primefaces.event.SlideEndEvent;

@ManagedBean
public class ConfiguratorBean {

/******************* VARIABLES ********************/
	private int nbvm;
	private int nbtaille;
	private int nbdispo;
	private int nbbp;
	private int outputvm;
	private String outputtaille = "Small";
	private String outputdispo = "Start";
	private String outputbp = "10Mbps";
	private int steptaille = 50;
	private int stepdispo = 50;
	private int stepbp = 100;

	
/******************* FUNCTIONS ********************/
	
	public void onSlideEndVM(SlideEndEvent event) {
		int value = event.getValue();
		outputvm = value;
	}

	public void onSlideEndTaille(SlideEndEvent event) {
		int value = event.getValue();
		switch (value) {
		case 0:
			outputtaille = "Small";
			break;
		case 50:
			outputtaille = "Large";
			break;
		default:
			outputtaille = "ExtraLarge";
		}
	}

	public void onSlideEndDispo(SlideEndEvent event) {
		int value = event.getValue();
		switch (value) {
		case 0:
			outputdispo = "Start";
			stepbp = 100;
			outputbp = "10Mbps";
			break;
		case 50:
			outputdispo = "Entreprise";
			stepbp = 25;
			outputbp = "20Mbps";
			break;
		case 100:
			outputdispo = "Critique";
			stepbp = 25;
			outputbp = "50Mbps";
		}
	}

	public void onSlideEndBP(SlideEndEvent event) {
		int value = event.getValue();
		switch (nbdispo) {
		case 0:
			switch (value) {
			case 0:
				outputbp = "10Mbps";
				break;
			case 100:
				outputbp = "20Mbps";
			}
		case 50:
			switch (value) {
			case 0:
				outputbp = "20Mbps";
				break;
			case 25:
				outputbp = "50Mbps";
				break;
			case 50:
				outputbp = "100Mbps";
				break;
			case 75:
				outputbp = "500Mbps";
				break;
			case 100:
				outputbp = "1Gbps";
			}
		case 100:
			switch (value) {
			case 0:
				outputbp = "50Mbps";
				break;
			case 25:
				outputbp = "100Mbps";
				break;
			case 50:
				outputbp = "500Mbps";
				break;
			case 75:
				outputbp = "1Gbps";
				break;
			case 100:
				outputbp = "2Gbps";
			}
		}
	}

/******************* GETTERS & SETTERS ********************/
	public int getSteptaille() {
		return steptaille;
	}

	public void setSteptaille(int steptaille) {
		this.steptaille = steptaille;
	}

	public int getNbvm() {
		return nbvm;
	}

	public void setNbvm(int nbvm) {
		this.nbvm = nbvm;
	}

	public int getOutputvm() {
		return outputvm;
	}

	public void setOutputvm(int outputvm) {
		this.outputvm = outputvm;
	}

	public int getNbtaille() {
		return nbtaille;
	}

	public void setNbtaille(int nbtaille) {
		this.nbtaille = nbtaille;
	}

	public String getOutputtaille() {
		return outputtaille;
	}

	public void setOutputtaille(String outputtaille) {
		this.outputtaille = outputtaille;
	}
	
	public int getNbdispo() {
		return nbdispo;
	}

	public void setNbdispo(int nbdispo) {
		this.nbdispo = nbdispo;
	}

	public String getOutputdispo() {
		return outputdispo;
	}

	public void setOutputdispo(String outputdispo) {
		this.outputdispo = outputdispo;
	}

	public int getStepdispo() {
		return stepdispo;
	}

	public void setStepdispo(int stepdispo) {
		this.stepdispo = stepdispo;
	}

	public int getNbbp() {
		return nbbp;
	}

	public void setNbbp(int nbbp) {
		this.nbbp = nbbp;
	}

	public int getStepbp() {
		return stepbp;
	}

	public void setStepbp(int stepbp) {
		this.stepbp = stepbp;
	}

	public String getOutputbp() {
		return outputbp;
	}

	public void setOutputbp(String outputbp) {
		this.outputbp = outputbp;
	}

}
